package com.yazi.mxz.fieldsale.common;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class Config {
	private static Logger log = LoggerFactory.getLogger(Config.class);
	private static Properties preperties;
	private static Config config;
	static {
		reset();
	}
	
	public static void reset() {
		preperties = new Properties();
		try {
			preperties.load(new FileInputStream(System.getenv("MXZ_HOME") + "version.ver"));
		} catch (IOException e) {
			log.error("版本文件[version.ver]", e);
		}
	}
	
	public static Config getInstance() {
		if (null == config) {
			config = new Config();
		}
		return config;
	}
	public String getVersion() {
		return String.valueOf(preperties.get("version"));
	}
	
}
